package com.lvy.hczn.front.system.domain.business;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lvy.hczn.front.common.core.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 采购单
 *
 * @author yw
 * @date 2021-12-15 10:00:09
 */
@Data
@TableName("purchase_order")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "采购单")
public class PurchaseOrder extends BaseModel<PurchaseOrder> {

    /**
     * 采购单编号
     */
    @ApiModelProperty(value = "采购单编号")
    private String purchaseOrderCode;

    /**
     * 采购员
     */
    @ApiModelProperty(value = "采购员")
    private String purchaserId;

    @ApiModelProperty(value = "数据来源")
    private String sourceId;

    @ApiModelProperty(value = "平台配送单号")
    private String deliveryCode;

    @ApiModelProperty(value = "业务类型:1销售配送/2销售退货配送/3发货配送/4拒收配送")
    private Integer serviceType;

    @ApiModelProperty(value = "业务单号:销售单号/销售退货单号/发货单号")
    private String serviceCode;

    @ApiModelProperty(value = "采购类型：0：采购入库（如：铺货补货等）；1：采购出库（如：调拨，总仓批发配送）")
    private Integer purchaseType;

    /**
     * 供应商
     */
    @ApiModelProperty(value = "供应商")
    private String supplierCode;

    @ApiModelProperty(value = "仓库编码")
    private String warehouseCode;

    @ApiModelProperty(value = "配送商类型:1:骑手,2:司机")
    private Integer deliveryType;

    /**
     * 配送方式(0:未选择配送方式;1:自己配送;2:平台配送)
     */
    @ApiModelProperty(value = "配送方式(0:未选择配送方式;1:自己配送;2:平台配送)")
    private String deliveryWay;

    @ApiModelProperty(value = "采购类型：0、自采(默认)；1、代采(第三方发布采购任务)；")
    private String purchaseSource;

    @ApiModelProperty(value = "委托采购的发布方")
    private String publisher;

    /**
     * 确认状态(0:未确认;1:已确认;2:超时;3:取消,4:已完成)
     */
    @ApiModelProperty(value = "确认状态(0:未确认;1:已确认;2:超时;3:取消,4:已完成)")
    private String confirmStatus;

    /**
     * 取货时间(供应商需在该时间之前备好货物)
     */
    @ApiModelProperty(value = "取货时间(供应商需在该时间之前备好货物)")
    private LocalDateTime deliveryTime;

    /**
     * 是否生成取货单（已生成，未生成）
     */
    @ApiModelProperty(value = "是否生成取货单（已生成，未生成）")
    private String deliveryStatus;

    /**
     * 配送费用
     */
    @ApiModelProperty(value = "配送费用")
    private BigDecimal distributionCost;

    /**
     * 采购单金额
     */
    @ApiModelProperty(value = "采购单金额")
    private BigDecimal price;

    @ApiModelProperty(value = "单据来源 0:C端,1:B端")
    private Integer sourceOrigin;

    @TableField(exist = false)
    private List<PurchaseOrderDetail> list;
}
